import React from 'react';
import { useSelector, useDispatch } from 'react-redux';

const Home = () => {
    const list = useSelector(state => state.homeData.list)
    // console.log(a)
    const dispatch = useDispatch();
    const add = () => {
        dispatch({ type: 'add_item', payload: 200 })
    }
    return (
        <div>
            Home<button onClick={add}>添加</button>
            <ul>
                {
                    list.map(item => <li>{item}</li>)
                }
            </ul>
        </div>
    )
}

export default Home
